import Vue from 'vue';

// #ifdef H5
import Router, { RouterMount } from '../static/uni-simple-router/index.js';
// #endif

// #ifndef H5 || APP-PLUS
import Router from 'uni-simple-router';
const RouterMount = {};
// #endif


// #ifdef APP-PLUS
import Router, { RouterMount } from '../static/uni-simple-router/index.js';
// #endif


import { GetPages } from '@/core';

Vue.use(Router);

const routesConfig = {
	encodeURI: false,
	debugger: true,
	routes: [
		{
			path: '/pages/index/index',
			aliasPath: '/',
			meta: {
				title: '赚分享',
			},
		},
		...GetPages(),
	],
};

const router = new Router(routesConfig);

router.beforeEach((to, from, next) => {
	// console.log(to, from);
	// if (from.name === 'index.about' && from.name !== to.name) {
	// } else {
	// 	next();
	// }

	next();

});

export { RouterMount, router };
